package com.quanxiaoha.weblog.admin.model.vo.blogsettings;

import com.quanxiaoha.weblog.admin.validator.ConditionalValidation;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author: 犬小哈
 * @url: www.quanxiaoha.com
 * @date: 2023-09-15 14:07
 * @description: 博客基础信息修改
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = " 博客基础信息修改 VO")
@ConditionalValidation(
    conditionField = "aiEnabled",
    conditionValue = "true",
    requiredFields = {"aiApiUrl", "aiApiKey", "aiModel", "aiTimeout", "aiMaxRetries"},
    messages = {
        "AI API地址不能为空，当前值: 'null'",
        "AI API密钥不能为空，当前值: 'null'", 
        "AI模型名称不能为空，当前值: 'null'",
        "aiTimeout AI请求超时时间不能为空，当前值: 'null'",
        "aiMaxRetries AI请求最大重试次数不能为空，当前值: 'null'"
    }
)
public class UpdateBlogSettingsReqVO {

    @NotBlank(message = "博客 LOGO 不能为空")
    private String logo;

    @NotBlank(message = "博客名称不能为空")
    private String name;

    @NotBlank(message = "博客作者不能为空")
    private String author;

    @NotBlank(message = "博客介绍语不能为空")
    private String introduction;

    @NotBlank(message = "博客头像不能为空")
    private String avatar;

    private String githubHomepage;

    private String csdnHomepage;

    private String giteeHomepage;

    private String zhihuHomepage;

    @Email(message = "邮箱格式不正确")
    private String mail;

    @NotNull(message = "请设置评论敏感词过滤是否开启")
    private Boolean isCommentSensiWordOpen;

    @NotNull(message = "请设置评论审核是否开启")
    private Boolean isCommentExamineOpen;

    /**
     * AI功能是否启用
     */
    private Boolean aiEnabled;

    /**
     * AI API地址
     */
    private String aiApiUrl;

    /**
     * AI API密钥
     */
    private String aiApiKey;

    /**
     * AI模型名称
     */
    private String aiModel;

    /**
     * AI请求超时时间（秒）
     */
    private Integer aiTimeout;

    /**
     * AI请求最大重试次数
     */
    private Integer aiMaxRetries;

    /**
     * AI流式输出是否启用
     */
    private Boolean aiStreamEnabled;
}
